<script>
  var app = {};
  app.debug = {% if app.debug %}true{% else %}false{% endif %};
  app.version = '{{ assets_version() }}';
  app.httpHost = '{{ app.request.getSchemeAndHttpHost() }}';
  app.basePath = '{{ app.request.getBasePath() }}';
  app.theme = '{{ setting("theme.uri"|default("default")) }}';
  app.jsPaths = {{ js_paths()|json_encode|raw }};

  app.config = {{
    {
      api:{
        weibo:{key:setting('login_bind.weibo_key', '')},
        qq:{key:setting('login_bind.qq_key', '')},
        douban:{key:setting('login_bind.douban_key', '')},
        renren:{key:setting('login_bind.renren_key', '')}
      },
      editor_upload_path: path('kindeditor_upload')
    }|json_encode|raw
  }};

  app.arguments = {};
  {% if script_controller is defined %}
    app.controller = '{{ script_controller }}';
  {% endif %}
  {% if script_arguments is defined %}
    app.arguments = {{ script_arguments|json_encode|raw }};
  {% endif %}
</script>
<script src="{{ asset('assets/libs/seajs/seajs/2.2.1/sea.js') }}"></script>
<script src="{{ asset('assets/libs/seajs/seajs-style/1.0.2/seajs-style.js') }}"></script>
<script src="{{ asset('assets/libs/seajs-global-config.js') }}"></script>
<script>
  seajs.use("{{ script_main }}")
</script>